﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Business;

namespace GraphicUserInterface.MainForm
{
    public partial class frVerifyPassphrase : Form
    {
        int iUserID;
        Form frSuccess;

        public frVerifyPassphrase(int iUserID, Form frSuccess)
        {
            InitializeComponent();
            this.iUserID = iUserID;
            this.frSuccess = frSuccess;
        }


        private void btBack_Click(object sender, EventArgs e)
        {
            this.Owner.Show();
            this.Close();
        }

        private void btContinue_Click(object sender, EventArgs e)
        {
            if (!KeyBUS.IsPassphraseValid(this.iUserID, this.tbPassphrase.Text))
            {
                MessageBox.Show("Passphrase không hợp lệ, vui lòng nhập lại");
                return;
            }

            frSuccess.Owner = this.Owner;
            frSuccess.Show();
            this.Close();
        }
    }
}
